<script setup lang="ts">
import { useAsyncComponents } from '@/hooks/useAsyncComponents'

const { openModal } = useAsyncComponents<'form'>()

const handleClick = async () => {
  await openModal({
    key: 'form',
    content: () => import('./Form.vue'),
    onLoaded(ctx) {
      console.log(ctx)
    }
  })
}

defineExpose({
  title: 'hello world'
})
</script>
<template>
  <a-form :model="{}">
    <a-form-item label="姓名">
      <a-input placeholder="请输入姓名"></a-input>
    </a-form-item>
    <a-form-item label="电话">
      <a-input placeholder="请输入电话"></a-input>
    </a-form-item>

    <a-button type="primary" @click="handleClick">打开内部弹窗</a-button>
  </a-form>
</template>
<style scoped lang="less"></style>
